// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_PUR_PURCHASE_ORDER_ITEM
// * CreateDate    : 2012/3/9 15:33:51
// * Creater       : CodeSmith
// * LastChangeDate: 2012/3/9 15:33:51
// * LastChanger   : 2012/3/9 15:33:51
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
	[Serializable]
	public partial class PurPurchaseOrderItemEntity : EntityBase
    {
        public PurPurchaseOrderItemTable TableSchema
        {
            get
            {
                return PurPurchaseOrderItemTable.Current;
            }
		}
		
		public PurPurchaseOrderItemEntity()
        {

        }
		
		public PurPurchaseOrderItemEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.PurchaseItemId = Convert.ToString(CommonFunctions.ToObject(dr["PURCHASE_ITEM_ID"]));
			this.PurchaseOrderId = Convert.ToString(CommonFunctions.ToObject(dr["PURCHASE_ORDER_ID"]));
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.PickingMaterialItemId = Convert.ToString(CommonFunctions.ToObject(dr["PICKING_MATERIAL_ITEM_ID"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.ArrivedQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["ARRIVED_QTY"]));
			this.PriceNoTax = Convert.ToDecimal(CommonFunctions.ToObject(dr["PRICE_NO_TAX"]));
			this.TaxRate = Convert.ToDecimal(CommonFunctions.ToObject(dr["TAX_RATE"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.ProductSpecIn = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC_IN"]));
			this.ProductSpecOut = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC_OUT"]));
        }
		
		public PurPurchaseOrderItemEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.PurchaseItemId = Convert.ToString(CommonFunctions.ToObject(dr["PURCHASE_ITEM_ID"]));
			this.PurchaseOrderId = Convert.ToString(CommonFunctions.ToObject(dr["PURCHASE_ORDER_ID"]));
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.PickingMaterialItemId = Convert.ToString(CommonFunctions.ToObject(dr["PICKING_MATERIAL_ITEM_ID"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.ArrivedQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["ARRIVED_QTY"]));
			this.PriceNoTax = Convert.ToDecimal(CommonFunctions.ToObject(dr["PRICE_NO_TAX"]));
			this.TaxRate = Convert.ToDecimal(CommonFunctions.ToObject(dr["TAX_RATE"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.ProductSpecIn = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC_IN"]));
			this.ProductSpecOut = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC_OUT"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return PurPurchaseOrderItemTable.Current;
            }
        }
		
		#region Perporty List
        public string PurchaseItemId
        {
            get { return Convert.ToString(GetData(PurPurchaseOrderItemTable.C_PURCHASE_ITEM_ID)); }
            set { SetData(PurPurchaseOrderItemTable.C_PURCHASE_ITEM_ID, value); }
        }
		
        public string PurchaseOrderId
        {
            get { return Convert.ToString(GetData(PurPurchaseOrderItemTable.C_PURCHASE_ORDER_ID)); }
            set { SetData(PurPurchaseOrderItemTable.C_PURCHASE_ORDER_ID, value); }
        }
		
        public string ProductId
        {
            get { return Convert.ToString(GetData(PurPurchaseOrderItemTable.C_PRODUCT_ID)); }
            set { SetData(PurPurchaseOrderItemTable.C_PRODUCT_ID, value); }
        }
		
        public string PickingMaterialItemId
        {
            get { return Convert.ToString(GetData(PurPurchaseOrderItemTable.C_PICKING_MATERIAL_ITEM_ID)); }
            set { SetData(PurPurchaseOrderItemTable.C_PICKING_MATERIAL_ITEM_ID, value); }
        }
		
        public decimal Qty
        {
            get { return Convert.ToDecimal(GetData(PurPurchaseOrderItemTable.C_QTY)); }
            set { SetData(PurPurchaseOrderItemTable.C_QTY, value); }
        }
		
        public decimal ArrivedQty
        {
            get { return Convert.ToDecimal(GetData(PurPurchaseOrderItemTable.C_ARRIVED_QTY)); }
            set { SetData(PurPurchaseOrderItemTable.C_ARRIVED_QTY, value); }
        }
		
        public decimal PriceNoTax
        {
            get { return Convert.ToDecimal(GetData(PurPurchaseOrderItemTable.C_PRICE_NO_TAX)); }
            set { SetData(PurPurchaseOrderItemTable.C_PRICE_NO_TAX, value); }
        }
		
        public decimal TaxRate
        {
            get { return Convert.ToDecimal(GetData(PurPurchaseOrderItemTable.C_TAX_RATE)); }
            set { SetData(PurPurchaseOrderItemTable.C_TAX_RATE, value); }
        }
		
        public string Remark
        {
            get { return Convert.ToString(GetData(PurPurchaseOrderItemTable.C_REMARK)); }
            set { SetData(PurPurchaseOrderItemTable.C_REMARK, value); }
        }
		
        public string ProductSpecIn
        {
            get { return Convert.ToString(GetData(PurPurchaseOrderItemTable.C_PRODUCT_SPEC_IN)); }
            set { SetData(PurPurchaseOrderItemTable.C_PRODUCT_SPEC_IN, value); }
        }
		
        public string ProductSpecOut
        {
            get { return Convert.ToString(GetData(PurPurchaseOrderItemTable.C_PRODUCT_SPEC_OUT)); }
            set { SetData(PurPurchaseOrderItemTable.C_PRODUCT_SPEC_OUT, value); }
        }

        #endregion

        #region Object Perporty
        public List<PurPurchaseOrderItemDetailEntity> PurchaseOrderItemDetailList
        {
            get;
            set;
        }
        #endregion
	}
	
	
}	

